package com.bzkj.common.exception;


/**
 * @author C1309
 * @description 用于封装NCC业务异常信息
 */
public class NccBusinessException extends RuntimeException {
    private static final long serialVersionUID = 1L;
    /**
     * 错误代码
     */
    private final int errorCode;

    /**
     * 上下文信息
     */
    private final String contextData;

    public NccBusinessException(String message){
        super(message);
        this.errorCode = 0;
        this.contextData = null;
    }

    public NccBusinessException(int errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
        this.contextData = null;
    }

    public NccBusinessException(int errorCode, String message, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
        this.contextData = null;
    }

    public NccBusinessException(int errorCode, String message, Object contextData) {
        super(message);
        this.errorCode = errorCode;
        this.contextData = contextData.toString();
    }

    // Getters
    public int getErrorCode() { return errorCode; }
    public String getContextData() { return contextData; }
}
